﻿using System;

public class Mapper140 : MapperDefault
{
    public override void init(NES nes)
    {
        base.init(nes);
    }

    public override void loadROM(ROM rom)
    {
        if (rom.Valid)
        {
            this.loadPRGROM();
            this.loadCHRROM();
            base.nes.Cpu.requestIrq(2);
        }
    }

    public override void write(int address, short value_Renamed)
    {
        if (address < 0x8000)
        {
            base.write(address, value_Renamed);
        }
        if ((address >= 0x6000) && (address < 0x8000))
        {
            int bank = (value_Renamed & 240) >> 4;
            int num2 = value_Renamed & 15;
            this.load32kRomBank(bank, 0x8000);
            this.load8kVromBank(num2, 0);
        }
    }
}

